﻿<UserControl x:Class="LEDStripMixer.Views.Editor.UserControls.ColourPicker"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" Width="166" Height="366">
    <UserControl.Resources>
        <DrawingBrush x:Key="CheckerboardBrush" 
        Stretch="None" TileMode="Tile" 
                 AlignmentX="Left" AlignmentY="Top" 
                 Viewport="0,0,10,10" ViewportUnits="Absolute">
            <DrawingBrush.Drawing>
                <DrawingGroup>
                    <GeometryDrawing Brush="sc# 1,1,1">
                        <GeometryDrawing.Geometry>
                            <RectangleGeometry Rect="0,0,10,10" />
                        </GeometryDrawing.Geometry>
                    </GeometryDrawing>
                    <GeometryDrawing Brush="sc# 0.5,0.5,0.5">
                        <GeometryDrawing.Geometry>
                            <RectangleGeometry Rect="0,0,5,5" />
                        </GeometryDrawing.Geometry>
                    </GeometryDrawing>
                    <GeometryDrawing Brush="sc# 0.5,0.5,0.5">
                        <GeometryDrawing.Geometry>
                            <RectangleGeometry Rect="5,5,5,5" />
                        </GeometryDrawing.Geometry>
                    </GeometryDrawing>
                </DrawingGroup>
            </DrawingBrush.Drawing>
        </DrawingBrush>
    </UserControl.Resources>

    <Grid Background="White">

        <Grid.RowDefinitions>
            <RowDefinition Height="35"/>
            <RowDefinition Height="300"/>
        </Grid.RowDefinitions>

        <StackPanel x:Name="SwatchSelect" Grid.Row="0" Height="35" 
                    HorizontalAlignment="Stretch"
                    Orientation="Horizontal" 
                    Background="Black">
            <Label Content="Swatch Type" 
                   Foreground="White" FontWeight="Bold" 
                   VerticalAlignment="Center"/>
            <Image x:Name="imgSwatch1" 
                   Height="20" Width="20" 
                   Source="Images/Swatch1.png" 
                   Margin="10,7.5,0,7.5" 
                   ToolTip="Square swatch1" 
                   MouseLeftButtonDown="Swatch_MouseLeftButtonDown"/>
            <Image x:Name="imgSwatch2" 
                   Height="20" Width="20" 
                   Source="/LEDStripMixer;component/Images/Swatch2.png" Margin="5,7.5,0,7.5" 
                   ToolTip="Square swatch2" 
                   MouseLeftButtonDown="Swatch_MouseLeftButtonDown"/>
            <Image x:Name="imgSwatch3" Height="20" Width="20" 
                   Source="/LEDStripMixer;component/Images/Swatch3.png" Margin="5,7.5,0,7.5" 
                   ToolTip="Circle swatch1" 
                   MouseLeftButtonDown="Swatch_MouseLeftButtonDown"/>
        </StackPanel>

        <Grid x:Name="MainContainer" Grid.Row="1" Margin="0,0,0,-31" Height="331" VerticalAlignment="Top">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="170"/>
                <ColumnDefinition Width="340"/>
            </Grid.ColumnDefinitions>

            <!-- Colorbox, Column1-->
            <Grid x:Name="MainSwatch" Grid.Column="0" 
                     Grid.Row="0" Margin="3,6,7,162" Cursor="Arrow" >

                <Border BorderBrush="Black" BorderThickness="5" 
                    HorizontalAlignment="Center" 
                    VerticalAlignment="Top"
                    Background="Black"
                    Width="154" Height="152" Margin="3,0,3,-11">
                </Border>



                <Image x:Name="ColorImage" 
                       Width="150" Height="150" 
                       HorizontalAlignment="Center"
                       VerticalAlignment="Top" Margin="5,2,5,0"
                       Source="/LEDStripMixer;component/Images/Swatch1.png"/>

                <Canvas x:Name="CanvImage" 
                       Width="150" Height="150" 
                       HorizontalAlignment="Center"
                       Background="Transparent"
                       VerticalAlignment="Top" Margin="5,2,5,0"
                       MouseDown="CanvImage_MouseDown"
                       MouseUp="CanvImage_MouseUp"
                       MouseMove="CanvImage_MouseMove" Cursor="Pen">
                    <Ellipse x:Name="ellipsePixel" Width="10" 
                       Height="10" Stroke="Black" Fill="White" Visibility="Hidden"/>

                </Canvas>


            </Grid>

            <!-- Preview, Column1-->

            <!-- TextBoxes, Column2-->
            <Grid x:Name="SwatchStats" Height="123" VerticalAlignment="Top" Margin="0,159,4,0">
                <Label Content="Red" Margin="20.166,-2.97,0,94.01" 
            		HorizontalAlignment="Left" 
            		Foreground="Black" FontWeight="Bold" 
            		VerticalAlignment="Center"/>
                <TextBox x:Name="txtRed" 
            		BorderThickness="0" Background="LightGray" 
            		BorderBrush="Transparent" 
            		Margin="18.313,18.97,112.687,76.03" IsReadOnly="True" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Width="35" Height="22" VerticalAlignment="Center"/>
                <Label Content="Blue" Margin="112,-2.47,0,93.51" 
            		HorizontalAlignment="Left" 
            		Foreground="Black" FontWeight="Bold" 
            		VerticalAlignment="Center"/>
                <TextBox x:Name="txtBlue" 
            		BorderThickness="0" Background="LightGray" 
            		BorderBrush="Transparent" 
            		Margin="112,18.97,19,76.03" IsReadOnly="True" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Width="35" Height="22" VerticalAlignment="Center"/>
                <Label Content="Green" Margin="60,-2.97,0,94.01" 
            		HorizontalAlignment="Left" 
            		Foreground="Black" FontWeight="Bold" 
            		VerticalAlignment="Center"/>
                <TextBox x:Name="txtGreen" BorderThickness="0" 
            		Background="LightGray" BorderBrush="Transparent" 
            		Margin="65,18.97,66,76.03" IsReadOnly="True" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Width="35" Height="22" VerticalAlignment="Center"/>
                <InkCanvas x:Name="inkSelectedColour" HorizontalAlignment="Left" Height="54" Margin="13,67.04,0,0" VerticalAlignment="Top" Width="139">
                    <Border BorderBrush="Black" BorderThickness="5" HorizontalAlignment="Left" Height="54" VerticalAlignment="Top" Width="139" Margin="0,0,-137,-52"/>
                </InkCanvas>
                <Label Content="Colour&#xA;" HorizontalAlignment="Center" Margin="57,45,61,0" VerticalAlignment="Top" FontWeight="Bold" Width="48"/>


            </Grid>
            <Grid x:Name="PaintBrushes" HorizontalAlignment="Left" Height="43" VerticalAlignment="Top" Width="166" Margin="0,284,0,0">
                <Button x:Name="btnBrush" Content="Brush" HorizontalAlignment="Left" VerticalAlignment="Top" Width="67" Margin="85,8.04,0,0" Height="27.96">
                	<Button.Effect>
                		<BlurEffect/>
                	</Button.Effect>
                </Button>
                <Button x:Name="btnPencil" Content="Pencil" HorizontalAlignment="Left" VerticalAlignment="Top" Width="67" Margin="13,8.04,0,0" Height="27.96">
                	<Button.Effect>
                		<BlurEffect/>
                	</Button.Effect>
                </Button>
            </Grid>

        </Grid>

        <!--AlphaSlider-->
    </Grid>
</UserControl>
